<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./react/react.development.js"></script>
    <script src="./react/react-dom.development.js"></script>
    <script src="./react/babel.min.js"></script>
    <script src="./react/prop-types.js"></script>
    <script src="./react/lodash.min.js"></script>
    <script src="./react/immutable.min.js"></script>

</head>
<body>
<div id="app"></div>
<script type="text/babel">

    let app = document.querySelector('#app');
    let root = ReactDOM.createRoot(app);

    class Welcome extends React.Component{
        state = {
            msg:'hello',
            city:'南昌',
            gender: '女'
        }
        handleChange = (ev) => {
            this.setState({
                city:ev.target.value
            })
        }

        render(){
            return(
                <div>
                    <select value={this.state.city} onChange={this.handleChange}>
                        <option value="北京">北京</option>
                        <option value="南昌">南昌</option>
                        <option value="南京">南京</option>
                        <option value="上海">上海</option>
                    </select>
                    {this.state.city}
                </div>
            )
        }
    }

    let element = (<Welcome/>)
    root.render(element);

</script>
</body>
</html>